Database applications are commonly used to store large amounts of data. One common application for such databases is business management. When used for business management, it is common for certain employees of a business to wish to be notified when certain events occur. In order to accomplish this, triggers may be set up such that if certain data in the database meets or violates certain conditions, alerts may be sent to the appropriate parties.
For example a department store may utilize a database to track inventory, sales, etc. In the men's department, there may be triggers to indicate when sweaters should be put on sale (based on, for example, high inventory, competitor pricing, or other market conditions). There may be many different types of triggers, for example one for sweaters, one for pants, etc.
Certain types of triggers need to be seen by certain employees. For example, a trigger involving sale prices or sales data may be directed towards a sales manager, whereas a trigger involving inventory levels may be directed towards an inventory manager.
One problem encountered with this approach is that there are often multiple parties that need to be made aware when certain trigger events occur. Most workplaces are divided into hierarchies, with the CEO or president at the top of the hierarchy, and rank-and-file workers at the bottom. In the middle are often several levels of managers. A number of salespeople may be managed by a sales manager who in turn may be managed by the vice president for sales and inventory. The vice president for sales and inventory may then also be managing an inventory manager.
It would be beneficial to have certain people in the hierarchy receive alerts that others are receiving as well. For example, it may be beneficial for a sales manager to see all alerts that the individual salespeople get. To that same extent, however, it may also be beneficial for such redundant alerts to be limited. In that, perhaps a manager or vice president may only wish to receive an alert regarding an underling if certain criteria are met (like a significant drop off in sales as opposed to a minor one, or a case where several different divisions report minor drop offs in sales as opposed to just one).
Currently, the only known mechanism to implement such triggers would be to utilize OR clauses in the triggers to cover all cases. An OR clause utilizes the boolean expression OR in between two variables. If either variable is true, then the OR clause is deemed to be true as well. OR clauses may be grouped together using other mathematical operators to form logical formulas. Applying OR clauses to a typical organization may involve linking 30 or 40 variables with OR clauses. This has several drawbacks. First, it is very cumbersome to write a trigger like this with so many OR clauses. Since the people setting up these triggers will often be high-level employees such as managers and vice presidents, they may not have the programming knowledge or free time to write so many OR clauses. Second, if any of the “lower-level” trigger's conditions change, someone needs to remember to go and update the “higher-level” trigger's condition. All of this results in a very inefficient solution.
What is needed is a more efficient solution to dealing with the need for triggers for more than one employee.